<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>四大作用域</title>
</head>
<body>
    <%
        /**
         * page作用域
         */
        // pageContext.setAttribute("name","tom");
        // System.out.println(pageContext.getAttribute("name"));

        /**
         * request作用域
         */
        // request.setAttribute("age",18);
        // System.out.println(request.getAttribute("age"));
        // 转发
        // request.getRequestDispatcher("test04.jsp").forward(request,response);
        // 重定向
        // response.sendRedirect("test04.jsp");

        /**
         * session作用域
         */
        // session.setAttribute("sex","male");
        // System.out.println(session.getAttribute("sex"));

        /**
         * application作用域
         */
        application.setAttribute("address","nanjing");
        System.out.println(application.getAttribute("address"));
    %>
</body>
</html>
